package com.caltco.cargo.ops.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.caltco.cargo.ops.common.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;

@Data
@TableName("user_achievements")
@Schema(description = "用户成就表")
public class UserAchievements extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "用户Id")
    private Long id;

    @Schema(description = "用户id")
    @TableField("user_id")
    @JsonProperty("userId")
    private Long userId;

    @Schema(description = "进度")
    private Integer progress;

    @Schema(description = "是否完成")
    @TableField("is_completed")
    @JsonProperty("isCompleted")
    private Integer isCompleted;

    @Schema(description = "成就id")
    @TableField("achievements_id")
    @JsonProperty("achievementsId")
    private Long achievementsId;

    @Schema(description = "是否删除")
    @TableField("is_delete")
    @JsonProperty("isDelete")
    @TableLogic(value = "0", delval = "1")
    private Integer isDelete;
}
